const router = require('koa-router')(),
    mysql = require('mysql2/promise'),
    {message} = require('../models');

router.prefix('/message');

//获取文章发布成功的通知根据作者user
router.get('/inform/:id',async(ctx,next)=>{
    const {id} = ctx.params;
    ctx.body = await message.inform(id)
})

//获取关注自己的粉丝 多表连接查询
router.get('/getFans/:id',async(ctx,next)=>{
    const {id} = ctx.params;
    ctx.body = await message.getFans(id);
})

//谁点赞我的作品
router.get('/getLike/:id',async(ctx,next)=>{
    const {id} = ctx.params;
    ctx.body = await message.getLike(id);
})
router.get('/getLikeImg/:id',async(ctx,next)=>{
    const {id} = ctx.params;
    ctx.body = await message.getLikeImg(id);
})

module.exports = router;